function resize(){
    let width = window.screen.width
    const  basicval = 750
    document.documentElement.style.fontSize = (width/basicval) * 100 + 'px'
}

window.addEventListener('resize',function(){
    resize()
})
window.addEventListener('DOMContentLoaded',function(){
    resize()
})

/**
 *  // 页面加载完毕加载
 window.addEventListener('load', function () {})
 
 // 只需要加载成功元素就可以
 window.addEventListener('DOMContentLoaded', function () {})

 // 只要窗口大小发生像素变化就会触发
 window.addEventListener('resize', function () {
 // 当前窗口宽度
 console.log(window.innerWidth);
 })
 
 */


